﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using CtCommon.Utility;
using Cxx.BLL;
using Cxx.Entity;

namespace Cxx.OrderManagerSys
{
    /// <summary>
    /// Payment 的摘要说明
    /// </summary>
    public class Payment : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            //context.Response.ContentType = "application/json";
            string idsStr = context.Request["ids"] ?? string.Empty;
            List<string> list = idsStr.Split(',').ToList();
            foreach (var item in list)
            {
                int id = item.ToInt32();
                OrderInfo info = Order.Get(id);
                if (info == null)
                {
                    continue;
                }
                info.Paymented = true;
                Order.Update(info);
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}